package com.zyuan.lawyerport.operation;

import android.content.Context;

import com.lzy.okgo.model.HttpParams;
import com.zyuan.lawyerport.config.Urls;

import common.base.interfaces.ViewInterface;
import common.base.operationHelper.Bean.BindingViewBean;
import common.base.operationHelper.Interface.OkGoHttpListener;
import common.base.operationHelper.OkGoHttp;
import common.tool.JsonTool;

public class Mod1Dao {
    private Context mContext;
    private OkGoHttp mOkGoHttp;
    private ViewInterface mViewInterface;

    public Mod1Dao(Context mContext, ViewInterface mViewInterface) {
        this.mContext = mContext;
        this.mViewInterface = mViewInterface;
        mOkGoHttp = new OkGoHttp(mContext);
    }

    public void Login() {
        HttpParams mParams = new HttpParams();
        mParams.put("region", "1");
        mOkGoHttp.Url(Urls.Login)
                .HttpParams(mParams)
                .Get(new OkGoHttpListener() {
                    @Override
                    public void onSuccess(String mString) {

//                        HomeThemeListBean mJsonBean = JsonTool.parseObject(mString, HomeThemeListBean.class);//Gson转Bean
//                        BindingViewBean mBindingViewBean = new BindingViewBean();
//                        mBindingViewBean.setBean(mJsonBean);
//                        mBindingViewBean.setmEnumStatus(BindingViewBean.EnumStatus. );
//                        mViewInterface.initBindingView(mBindingViewBean);
//                        mViewInterface.initLoadEnd();

                    }

                    @Override
                    public void onError(String mString) {

                    }
                });

    }

}
